<template>
  <div class="classic-mode">
    <div class="mode-header">
      <h1>经典模式</h1>
      <p>传统的桌面角色扮演游戏体验</p>
    </div>
    
    <div class="mode-content">
      <el-row :gutter="20">
        <el-col :xs="24" :sm="12" :md="8">
          <el-card class="feature-card">
            <template #header>
              <div class="card-header">
                <el-icon><User /></el-icon>
                <span>角色管理</span>
              </div>
            </template>
            <p>创建和管理您的角色卡，支持COC7版规则</p>
            <el-button type="primary" @click="showCharacterSheet = true">打开角色卡</el-button>
          </el-card>
        </el-col>
        
        <el-col :xs="24" :sm="12" :md="8">
          <el-card class="feature-card">
            <template #header>
              <div class="card-header">
                <el-icon><MapLocation /></el-icon>
                <span>地图探索</span>
              </div>
            </template>
            <p>在迷雾地图中探索未知区域，发现隐藏的秘密</p>
            <el-button type="primary" @click="showMapEditor = true">打开地图</el-button>
          </el-card>
        </el-col>
        
        <el-col :xs="24" :sm="12" :md="8">
          <el-card class="feature-card">
            <template #header>
              <div class="card-header">
                <el-icon><Dice /></el-icon>
                <span>骰子系统</span>
              </div>
            </template>
            <p>使用骰娘助手进行各种检定和掷骰</p>
            <el-button type="primary" @click="showDiceBot = true">打开骰娘</el-button>
          </el-card>
        </el-col>
      </el-row>
    </div>

    <!-- 角色卡对话框 -->
    <el-dialog
      v-model="showCharacterSheet"
      title="角色卡"
      width="90%"
      :before-close="handleCloseCharacterSheet"
    >
      <CharacterSheet />
    </el-dialog>

    <!-- 地图编辑器对话框 -->
    <el-dialog
      v-model="showMapEditor"
      title="地图编辑器"
      width="95%"
      :before-close="handleCloseMapEditor"
    >
      <MapEditor />
    </el-dialog>

    <!-- 骰娘对话框 -->
    <el-dialog
      v-model="showDiceBot"
      title="骰娘助手"
      width="600px"
      :before-close="handleCloseDiceBot"
    >
      <DiceBot />
    </el-dialog>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import CharacterSheet from '@/components/CharacterSheet.vue'
import DiceBot from '@/components/DiceBot.vue'
import MapEditor from '@/components/MapEditor.vue'

// 响应式数据
const showCharacterSheet = ref(false)
const showMapEditor = ref(false)
const showDiceBot = ref(false)

// 方法
const handleCloseCharacterSheet = () => {
  showCharacterSheet.value = false
}

const handleCloseMapEditor = () => {
  showMapEditor.value = false
}

const handleCloseDiceBot = () => {
  showDiceBot.value = false
}
</script>

<style scoped>
.classic-mode {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.mode-header {
  text-align: center;
  margin-bottom: 40px;
}

.mode-header h1 {
  font-size: 36px;
  margin: 0 0 16px 0;
  color: #333;
}

.mode-header p {
  font-size: 18px;
  color: #666;
  margin: 0;
}

.mode-content {
  margin-top: 40px;
}

.feature-card {
  height: 100%;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
}

.card-header .el-icon {
  font-size: 20px;
  color: #667eea;
}

.feature-card p {
  color: #666;
  line-height: 1.6;
  margin: 16px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .classic-mode {
    padding: 20px 10px;
  }
  
  .mode-header h1 {
    font-size: 28px;
  }
  
  .mode-header p {
    font-size: 16px;
  }
}
</style>
